Skip to content

Paginate issue discovery to handle >100 autoloop programs#14

Merged
mrjf merged 2 commits intomainfrom
copilot/paginate-issues
Apr 4, 2026
Merged

Paginate issue discovery to handle >100 autoloop programs#14
mrjf merged 2 commits intomainfrom
copilot/paginate-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

Issue fetching used a single per_page=100 call with no Link header follow — silent data loss once a repo exceeds 100 open autoloop-program issues.

Changes

  • workflows/autoloop.md: Add parseLinkHeader() utility to extract rel="next" URL from GitHub API Link headers. Replace single-fetch with a while loop that accumulates all pages:
    let nextUrl = '...&per_page=100';
    const issues = [];
    while (nextUrl) {
        const response = await fetch(nextUrl, { headers: { ... } });
        issues.push(...await response.json());
        nextUrl = parseLinkHeader(response.headers.get('link'));
    }
  • tests/: Export parseLinkHeader from the extracted JS module; add 6 unit tests covering null/empty input, single and multi-segment headers, missing rel="next", and mid-position next links.

Copilot AI assigned Copilot and mrjf Apr 4, 2026
Copilot AI linked an issue Apr 4, 2026 that may be closed by this pull request
Add parseLinkHeader() helper to extract the next URL from GitHub API
Link headers. Replace single-fetch issue discovery with a paginated
while loop that follows Link headers until all pages are fetched.

Add unit tests for parseLinkHeader and export from test infrastructure.

Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/4c3fac44-c844-4240-9fb4-b90b2f2d76bc

Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot AI changed the title [WIP] Add pagination for issue discovery Paginate issue discovery to handle >100 autoloop programs Apr 4, 2026
Copilot AI requested a review from mrjf April 4, 2026 04:38
Copilot finished work on behalf of mrjf April 4, 2026 04:38
@mrjf mrjf marked this pull request as ready for review April 4, 2026 04:53
@mrjf mrjf merged commit 23af2cc into main Apr 4, 2026
15 checks passed
@mrjf mrjf deleted the copilot/paginate-issues branch April 4, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paginate issues

2 participants